package com.choupin.choupin.entity;

import cn.hutool.core.date.DateTime;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

public class Prize extends  BaseEntity {
      private  Integer id; //奖品表id
    private String  phone;// 外键，用户表手机号',
    private  Integer turnId;// 转盘表id
    private Integer turntableId;// 转盘分片id
    private  String name;// 奖品名称
    private  String image; // 奖品图片
    private  LocalDateTime prizeTime;//中奖时间
    private  LocalDateTime  endTime;//截止兑换时间
    private  Integer exchangeStatus;// '0未兑换  1兑换成功  2兑换失败   3过期 ',

    public Prize() {
    }

    public Prize(Integer id, String phone, Integer turnId, Integer turntableId, String name, String image, LocalDateTime prizeTime, LocalDateTime endTime, Integer exchangeStatus) {
        this.id = id;
        this.phone = phone;
        this.turnId = turnId;
        this.turntableId = turntableId;
        this.name = name;
        this.image = image;
        this.prizeTime = prizeTime;
        this.endTime = endTime;
        this.exchangeStatus = exchangeStatus;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getTurnId() {
        return turnId;
    }

    public void setTurnId(Integer turnId) {
        this.turnId = turnId;
    }

    public Integer getTurntableId() {
        return turntableId;
    }

    public void setTurntableId(Integer turntableId) {
        this.turntableId = turntableId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public LocalDateTime getPrizeTime() {
        return prizeTime;
    }

    public void setPrizeTime(LocalDateTime prizeTime) {
        this.prizeTime = prizeTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getExchangeStatus() {
        return exchangeStatus;
    }

    public void setExchangeStatus(Integer exchangeStatus) {
        this.exchangeStatus = exchangeStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Prize prize = (Prize) o;
        return Objects.equals(id, prize.id) &&
                Objects.equals(phone, prize.phone) &&
                Objects.equals(turnId, prize.turnId) &&
                Objects.equals(turntableId, prize.turntableId) &&
                Objects.equals(name, prize.name) &&
                Objects.equals(image, prize.image) &&
                Objects.equals(prizeTime, prize.prizeTime) &&
                Objects.equals(endTime, prize.endTime) &&
                Objects.equals(exchangeStatus, prize.exchangeStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, phone, turnId, turntableId, name, image, prizeTime, endTime, exchangeStatus);
    }

    @Override
    public String toString() {
        return "Prize{" +
                "id=" + id +
                ", phone='" + phone + '\'' +
                ", turnId=" + turnId +
                ", turntableId=" + turntableId +
                ", name='" + name + '\'' +
                ", image='" + image + '\'' +
                ", prizeTime=" + prizeTime +
                ", endTime=" + endTime +
                ", exchangeStatus=" + exchangeStatus +
                ", createdUser='" + createdUser + '\'' +
                ", createdTime=" + createdTime +
                ", modifiedUser='" + modifiedUser + '\'' +
                ", modifiedTime=" + modifiedTime +
                '}';
    }
}
